<?php
    
    require_once( MODEL_DIR . "Model.class.php");
    
    class LetrasModel extends Model{
        
        protected $query;
        
        public function __construct()
        {
            parent::__construct();
        }
        
        # listar letras 
        public function get_letras_id( $id ){
            
            $set_where = " id = $id ";
            
            return parent::read("letras",$set_where,0,0,1);
            
        }
        
        # listar letras 
        public function get_letras_busca( $value ){
            
            $set_where = " id = $id ";
            
            return parent::read("letras",$set_where,0,0,1);
            
        }
        
        
        public function ListaLetrasBusca($value)
        {
            $sql = "SELECT * FROM letras WHERE artista LIKE '%$value%' ORDER BY id DESC LIMIT 0,5";
            $result = mysql_query($sql);
            while($line = mysql_fetch_assoc($result))$var[] = $line;
            return $var;
        }
        
        
        
    }        
?>